import { lazy } from 'react'
import { Route, Routes } from 'react-router'
import Home from '../pages/Home'
const Order = lazy(() => import('../pages/Order'))
const Find = lazy(() => import('../pages/Find'))
const Mine = lazy(() => import('../pages/Mine'))
const Cities = lazy(() => import('../pages/Cities'))
const HomeDetail = lazy(() => import('../pages/HomeDetail'))
const HomeOrder = lazy(() => import('../pages/HomeDetail/HomeOrder'))
const HomeComment = lazy(() => import('../pages/HomeDetail/HomeComment'))
const HomeBusiness = lazy(() => import('../pages/HomeDetail/HomeBusiness'))

export default function RoutesConfig() {
    return (
        <>
            <Routes>
                <Route path='/' element={<Home />} />
                <Route path='/home' element={<Home />} />
                <Route path='/order' element={<Order />} />
                <Route path='/find' element={<Find />} />
                <Route path='/mine' element={<Mine />} />
                <Route path='/cities' element={<Cities />} />
                <Route path='/homedetail/:id' element={<HomeDetail />} >
                    <Route path='/homedetail/:id/order' element={<HomeOrder />} />
                    <Route path='/homedetail/:id/comment' element={<HomeComment />} />
                    <Route path='/homedetail/:id/business' element={<HomeBusiness />} />
                </Route>
            </Routes>
        </>
    )
}
